//
// Created by 123 on 2025/1/2.
//

#include "iostream"
using namespace std;

class Base{
public:
    static int ma;
    static void func(){
        cout << "base static func" << endl;
    }
    static void func(int a){
        cout << "base static func(a)" << endl;
    }
};

int Base::ma = 20;

class Son : public Base{
public:
    static int ma;
    static void func(){
        cout << "son static func" << endl;
    }
};

int Son::ma = 200;

void test1(){
    //通过对象访问
    Son s;
    cout << "1 son ma=" << s.ma;
    cout << "1 Base ma=" << s.Base::ma << endl;
    //通过类名访问
    cout << "2 son ma=" << Son::ma;
    cout << "2 Base ma=" << Son::Base::ma << endl;
}

void test2(){
    Son s;
    s.func();
    s.Base::func();

    Son::func();
    Son::Base::func();
    Son::Base::func(10);
}

int main082(){
    test1();
    test2();
    return 0;
}